<style type="text/css">
	#imgbox {height: 330px;width:580px;padding:10px;overflow: scroll;text-align:center;}
</style>
</head>
<body>
<div class="w600 h380">
	<div id="imgbox"><img src="{$imgurl}" /></div>
	<form id="cropform" action="{url('files/crop_images_save')}">
	<div class="btn h30 tac p5">
		<input name="imgurl" id="imgurl" type="hidden" value="{$imgurl}" />
		<input name="frameid" id="frameid" type="hidden" value="{$frameid}" />
		缩放比例-->最大宽度: <input datatype="n" nullmsg="不能为空" errormsg="只能输入数字" class="input w40" type="text" name="w" /> 
		最大高度: <input datatype="n" nullmsg="不能为空" errormsg="只能输入数字" class="input w40" type="text" name="h" /> 
			<input class="button look" type="button" value="预览" >
		   <input class="button" type="submit" value="保存" >
		   <input class="button" type="button" onclick="$.dialog.close()" value="关闭" >
	</div>
	</form>
</div>
<script type="text/javascript">
$(function(){
		$('.look').click(function(){
		var picurl =  $("#imgurl").val();
		var w =  $('input[name="w"]').val();
		var h =  $('input[name="h"]').val();
		$("#imgbox").html('<img src="'+picurl+'" width="'+w+'" height="'+h+'" />');
		})
})
$(function(){
  $("#cropform").Validform({
    btnSubmit:".submit",showAllError:true,
    tiptype:function(msg){
      $.dialog.through({id: 'vform',time: 2,lock:true,content: msg});
    },
    tipSweep:true,
    ajaxPost:true,
    callback:function(data){
      if(data.status=='1'){
        art.dialog.confirm(data.info,function(){
           //$.dialog.top.frames['main'].location.replace(data.url); 
           $.dialog.close()
        }, function(){art.dialog.tips('你取消了操作!', 1.5);});
      }else{
       $.dialog.through({id: 'vform',time: 2,lock:true,content:data.info});
      }
    }
  });
})
</script>